#include"heap.h"
//void test1()
//{
//	Heap heap;
//	HeapInit(&heap);
//	HeapPush(&heap, 11);
//	HeapPush(&heap, 2);
//	HeapPush(&heap, 3);
//	HeapPush(&heap, 4);
//	HeapPop(&heap);
//	printf("%d\n", HeapTop(&heap));
//	HeapPrint(&heap);
//}
void test2()
{
	int arr[] = { 1,2,3,4,5,6,7,8,9 };
	int sz = sizeof(arr) / sizeof(arr[0]);
	HeapSort(arr, sz);
	for (int i = 0; i < sz; i++)
	{
		printf("%d ", arr[i]);
	}
}
void test3()
{
	int n = 10000;
	int* a = (int*)malloc(sizeof(int) * n);
	srand(time(0));
	for (size_t i = 0; i < n; ++i)
	{
		a[i] = rand() % 1000000;
	}
	a[5] = 1000000 + 1;
	a[1231] = 1000000 + 2;
	a[531] = 1000000 + 3;
	a[5121] = 1000000 + 4;
	a[115] = 1000000 + 5;
	a[2305] = 1000000 + 6;
	a[99] = 1000000 + 7;
	a[76] = 1000000 + 8;
	a[423] = 1000000 + 9;
	a[0] = 1000000 + 1000;
	TopK(a, n, 10);
}
int main()
{
	/*test1();*/
	/*test2();*/
	test3();
}